﻿//Created by Action Script Viewer - http://www.buraks.com/asv
package org.aswing.plaf.basic.border {
    import flash.display.*;
    import org.aswing.*;
    import flash.filters.*;
    import org.aswing.geom.*;
    import org.aswing.plaf.*;
    import org.aswing.graphics.*;
    import org.aswing.plaf.basic.*;

    public class PopupMenuBorder implements Border, UIResource {

        protected var shape:Shape;

        public function PopupMenuBorder(){
            this.shape = new Shape();
        }
        public function updateBorder(_arg1:Component, _arg2:Graphics2D, _arg3:IntRectangle):void{
            var _local4:StyleTune;
            var _local5:ASColor;
            var _local6:StyleResult;
            this.shape.graphics.clear();
            if (_arg1.isOpaque()){
                _arg3 = _arg3.clone();
                _arg3.height = (_arg3.height - 4);
                _arg3.width = (_arg3.width - 4);
                _arg2 = new Graphics2D(this.shape.graphics);
                _local4 = _arg1.getStyleTune();
                _local5 = _arg1.getBackground();
                _local6 = new StyleResult(_local5.changeAlpha(1), _local4);
                BasicGraphicsUtils.fillGradientRoundRect(_arg2, _arg3, _local6, (Math.PI / 2));
                BasicGraphicsUtils.drawGradientRoundRectLine(_arg2, _arg3, 1, _local6, (Math.PI / 2));
                this.shape.filters = [new DropShadowFilter(1, 45, 0, _local6.shadow, 4, 4, 1, 1)];
                this.shape.alpha = _local5.getAlpha();
            };
            this.shape.visible = _arg1.isOpaque();
        }
        public function getBorderInsets(_arg1:Component, _arg2:IntRectangle):Insets{
            return (new Insets(2, 2, 6, 6));
        }
        public function getDisplay(_arg1:Component):DisplayObject{
            return (this.shape);
        }

    }
}//package org.aswing.plaf.basic.border 
